

import java.io.File;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.List;

public class test {

	private static void deleteAllFilesOfDir(File path) {  
		if (!path.exists())  
	        return;  
	    if (path.isFile()) {  
	        path.delete();  
	        return;  
	    }  
	    File[] files = path.listFiles();  
	    for (int i = 0; i < files.length; i++) {  
	        deleteAllFilesOfDir(files[i]);  
	    }  
	    path.delete();  
	}  
	
	public static void main(String[] args) throws ParseException {
		// TODO Auto-generated method stub
//		System.out.println(Md5Util.md5("123456"));
//		Implment implment = new Implment();
//		int i = implment.userlogin("lwj", "123456");
//		implment.getRepositoryVersion("lwj", "123456", 34l);
//		implment.pullRepositoryByVersion("test", "123456", new Long(35), "E:/git-test/123", "2.0");
//		System.out.println(i);
		
//		ConfigUtils a= new ConfigUtils();
//		System.out.println(a.getIp());
//		System.out.println(implment.isRepository("E:/git-test/123"));
		
//		File f = new File("E:/git-test/123");
//		deleteAllFilesOfDir(f);
//		System.out.println(f.list().length);
//		implment.userlogin("lwj", "123456");
//		implment.login();
		
		/**
		 * testshowRepository
		 */
		Implement implment = new Implement();
		implment.showRepository("lwj", "123456");
		List<Project> list = implment.showRepository("lwj", "123456");
		System.out.println(list.size());
		for(int i = 0;i<list.size();i++){
			System.out.println(list.get(i).getProjectId()+" "+list.get(i).getName()+" "+list.get(i).getDesc()+" "+list.get(i).getTime());
			for(int j = 0;j<list.get(i).getRepository().size();j++){
				System.out.println(list.get(i).getRepository().get(j).getRepoId());
			}
		}
		
		/**
		 * testpushMethod
		 */
//		Implement implment = new Implement();
//		List<String> repo = new ArrayList<String>();
//		repo.add("d://4//hellofirst");
//		repo.add("d://4//gitserver1");
//		int i = implment.pushMethod("lwj", "123456", repo, "testpushMethod");
//		System.out.println(i);
		
		/**
		 * testpullMethod
		 */
		
//		Implement implment = new Implement();
//		List<Long> repo = new ArrayList<Long>();
//		repo.add(34l);
//		repo.add(35l);
//		int i = implment.pullMethod("lwj", "123456", "d://4//", repo);
//		System.out.println(i);								
	}

}
